/* ****************************************************************************
 *
 * Copyright (c) Microsoft Corporation. 
 *
 * This source code is subject to terms and conditions of the Microsoft Public License. A 
 * copy of the license can be found in the License.html file at the root of this distribution. If 
 * you cannot locate the  Microsoft Public License, please send an email to 
 * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound 
 * by the terms of the Microsoft Public License.
 *
 * You must not remove this notice, or any other, from this software.
 *
 * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
 * PARTICULAR PURPOSE.
 * ***************************************************************************/

#include "stdafx.h"
#include <pgl/mfc/PGLMFCGlobal.h>

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
LPCTSTR CPGLMFCGlobal::GetVersion()
{
	return _T("3.5.2.2");
}


HMODULE CPGLMFCGlobal::GetInstance()
{
	HMODULE hInst;

	/*
// getting module handle
#if _MSC_VER >= 1300
	#ifndef _UNICODE
		#ifdef _DEBUG
			hInst=GetModuleHandle(_T("PGLMFC7d.dll"));
		#else
			hInst=GetModuleHandle(_T("PGLMFC7.dll"));
		#endif
	#else
		#ifdef _DEBUG
			hInst=GetModuleHandle(_T("PGLMFC7ud.dll"));
		#else
			hInst=GetModuleHandle(_T("PGLMFC7u.dll"));
		#endif
	#endif
#else
	#ifndef _UNICODE
		#ifdef _DEBUG
			hInst=GetModuleHandle(_T("PGLMFCd.dll"));
		#else
			hInst=GetModuleHandle(_T("PGLMFC.dll"));
		#endif
	#else
		#ifdef _DEBUG
			hInst=GetModuleHandle(_T("PGLMFCud.dll"));
		#else
			hInst=GetModuleHandle(_T("PGLMFCu.dll"));
		#endif
	#endif
#endif
	*/

	#ifndef _UNICODE
	#ifdef _DEBUG
	hInst=LoadLibrary(_T("PGLMFC_d.dll"));
		//hInst=GetModuleHandle(_T("PGLMFCd.dll"));
	#else
	hInst=LoadLibrary(_T("PGLMFC.dll"));
		//hInst=GetModuleHandle(_T("PGLMFC.dll"));
	#endif
	#else
	#ifdef _DEBUG
	hInst=LoadLibrary(_T("PGLMFC_d.dll"));
		//hInst=GetModuleHandle(_T("PGLMFCud.dll"));
	#else
	hInst=LoadLibrary(_T("PGLMFC.dll"));
		//hInst=GetModuleHandle(_T("PGLMFCu.dll"));
	#endif
	#endif
	return hInst;
}

